{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "6bab5d02-87da-46ca-aaa7-63ab32c67f73",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "(unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \\UXXXXXXXX escape (2615552620.py, line 4)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Cell \u001b[1;32mIn[11], line 4\u001b[1;36m\u001b[0m\n\u001b[1;33m    input_file = 'C:\\Users\\ERTG\\Documents\\CHEMKIN\\post_adiabatic_flame_06.dat'\u001b[0m\n\u001b[1;37m                 ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \\UXXXXXXXX escape\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "# Load the data from the original file\n",
    "input_file = 'C:\\Users\\ERTG\\Documents\\CHEMKIN\\post_adiabatic_flame_06.dat'\n",
    "\n",
    "\n",
    "data = np.loadtxt(input_file)\n",
    "\n",
    "# Now, we need to format the data\n",
    "formatted_data = \"\"\n",
    "\n",
    "# Convert the data to a formatted string\n",
    "for row in data:\n",
    "    formatted_row = \" \".join([f\"{num: .6e}\" for num in row])  # Adjust the format as needed\n",
    "    formatted_data += formatted_row + \"\\n\"\n",
    "\n",
    "# Save the formatted data to a new file\n",
    "output_file = 'path_to_your_output_file/formatted_FGM.dat'\n",
    "with open(output_file, 'w') as file:\n",
    "    file.write(formatted_data)\n",
    "\n",
    "print(f\"Formatted file saved to {output_file}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b754e54c-025d-4dd7-9c32-56bfaf20d45f",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
